package com.lcxw.hxzbapi.controller.appcontroller;

import com.lcxw.hxzbapi.controller.membercontroller.MemberRealization;
import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lcxw.hxzbapi.entity.pojo.YwpdMember;
import com.lcxw.hxzbapi.entity.requestBean.RegisterRequestParam;
import com.lcxw.hxzbapi.entity.response.Response;
import com.lcxw.hxzbapi.service.YwpdMemberService;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/api/user")
public class RegisterController {

    private Logger logger = LoggerFactory.getLogger(RegisterController.class);

    @Resource
    private YwpdMemberService ywpdMemberService;

    @PostMapping("/register")
    public Response register(@Valid @RequestBody RegisterRequestParam registerRequestParam) {
        logger.info("注册请求： {}", registerRequestParam);

        YwpdMember ywpdMember = new YwpdMember();
        ywpdMember.setTelephone(registerRequestParam.getTelephone());
        ywpdMember.setPassword(registerRequestParam.getPassword());
        return ywpdMemberService.register(ywpdMember);


    }

}
